//
//  String + Extension.swift
//  emoji表情
//
//  Created by 余仿 on 16/4/18.
//  Copyright © 2016年 yf. All rights reserved.
//

import Foundation


extension String{

    func emoji2Str() -> String?{

        //从字符串中查找十六进制字符串
        let scanner = NSScanner(string: self)
        //将16进制字符串转成十六进制整数
        var value:UInt32 = 0

        scanner.scanHexInt(&value)

        //将16进制的整数转成Unicode字符
        let code = Character(UnicodeScalar(value))

        return "\(code)"
        
    }
    
}